<template>
  <div class="map">
    <header>
      <div class="header-one">
        <span @click="goback()">
          <van-icon name="arrow-left" />
        </span>
        <span>地图找房</span>
        <span>
          <van-icon name="more-o" />
        </span>
      </div>
      <div class="header-two">
        <div class="search">
          <div class="option">
            <span>
              <!-- {{this.name}} -->
              <a-icon type="caret-down" />
            </span>
          </div>
          <div class="input">
            <input type="text" placeholder="请在这里输入区域/商圈" />
            <van-icon name="search" class="icon" />
          </div>
          <span></span>
        </div>
        <div class="hint">
          <div>
            <span>
              <img src="../imgs/14.png" alt />
            </span>
            <span class="active">买房</span>
          </div>
          <div>
            <span>
              <img src="../imgs/14.png" alt />
            </span>
            <span>租房</span>
          </div>
        </div>
      </div>
      <div class="header-three">
        <li>
          区域
          <a-icon type="caret-down" />
        </li>
        <li>
          价格
          <a-icon type="caret-down" />
        </li>
        <li>
          户型
          <a-icon type="caret-down" />
        </li>
        <li>
          距离
          <a-icon type="caret-down" />
        </li>
        <li>
          <van-icon name="sort" />
        </li>
      </div>
    </header>
    <main>
      <div class="plat">
        <label>
          关键词：
          <input v-model="keyword" />
        </label>
        <!-- <label>
          地区：
          <input v-model="location" />
        </label>-->
        <baidu-map>
          <bm-view class="map"></bm-view>
          <bm-city-list anchor="BMAP_ANCHOR_TOP_LEFT"></bm-city-list>
          <!-- <bm-local-search :keyword="keyword" :auto-viewport="true" :location="location"></bm-local-search> -->
          <bm-driving
            start="宿扬高速"
            end="新街口"
            startCity="天长市"
            endCity="南京"
            :auto-viewport="true"
          ></bm-driving>
        </baidu-map>
      </div>
    </main>
  </div>
</template>

<script>
export default {
  data() {
    return {
      location: "北京",
      keyword: "上海"
    };
  },
  methods:{
    goback(){
      this.$router.go(-1)
    }
  }
};
</script>

<style scoped>

header {
  height: 358px;
  border-bottom: 1px solid #cccccc;
}
.header-one {
  height: 97px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 30px;
  font-size: 22px;
  color: #f3f9ff;
  content: "";
  background: linear-gradient(45deg, #0f7ef4, #1988f6, #34a0fd);
}
.header-two {
  height: 203px;
  border-bottom: 1px solid #bcbcbc;
}
.header-three {
  display: flex;
  height: 59px;
  align-items: center;
  justify-content: space-between;
  padding: 0px 30px;
  color: #999999;
}
.search {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 10px;
  border-bottom: 1px solid #cccccc;
  color: #9b9b9b;
}
.option select {
  background: none;
  border: none;
  outline: none;
}
.option select option {
  background: #82b9f3;
}
.input {
  width: 200px;
  height: 30px;
  border: 1px solid #cccccc;
  display: inline-block;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.input span {
  color: #929292;
}
.input input {
  border: none;
  background: none;
  outline: none;
}
.input .icon {
  color: #9c9c9c;
  font-weight: bold;
  font-size: 20px;
}
.hint {
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 40px;
}
.hint div {
  text-align: center;
}
.hint div .active {
  color: #ff6d3c;
}
.hint div span {
  display: block;
  font-size: 18px;
  font-weight: 600;
}
.map {
  width: 100%;
  height: 400px;
}
main{
  flex: 1;
  overflow-y: auto;
}
</style>